<div class="container member-container">
    <?php include $this->getViewFile('../lib/leftmenu'); ?>
    <div class="col-md-10 member-con menber-score-con">
        <div class="title mb-common-title">绑定列表</div>
        <div class="content">
            <table width="885">
                <thead>
                  <tr>
                    <td align="center" width="100">账号类型</td>
                    <td align="center" width="100">会员ID</td>
                    <td align="center" width="">注册时间</td>
                    <td align="center" width="">操作</td>
                  </tr>
                </thead>
                <tbody>
                    <?php
                    foreach($data as $key => $rs){
                    ?>
                    <tr>
                        <td align="center"><?php echo $key ?></td>
                        <td align="center"><?php echo empty($rs) ? '' : $rs->uid ?></td>
                        <td align="center" width="100"><?php echo empty($rs) ? '' : date('Y-m-d H:i:s',$rs->regdate) ?></td>

                        <td  align="center" width="100">
                            <?php if($rs){ ?>
                            <span data-id="<?php echo $rs->id ?>" class="unbund" style="cursor:pointer">解绑</span>
                            <?php }else{ ?>
                            <span  class="bund" style="cursor:pointer"><a href="<?php echo YzwController::U("user/oauth/".($key=='qq'?'qqreg':'sinareg')) ?>">绑定</a></span>
                            <?php } ?>
                        </td>
                    </tr>
                    <?php
                    }
                    ?>
   
                </tbody>
            </table>
        </div>
    </div>
    <div class="clearfix"></div>
</div>


<link rel="stylesheet" href="<?php echo Yii::app()->params->staticUrl; ?>statics/js/artDialog6/css/ui-dialog.css">
<script src="<?php echo Yii::app()->params->staticUrl; ?>statics/js/artDialog6/js/dialog-min.js"></script>
<script type="text/javascript">
    $(".unbund").click(function(){
        var obj = $(this);
        var id = $(this).data('id');
        if(id > 0)
        {
            var data = {id:id};
        }else
        {
            alert('找不到此记录');
            return false;
        }

        $.post('<?php echo YzwController::U("unbund") ?>',data,function(rs){
            if(rs.status){
                 dialog({
                    fixed: true,
                    title: '提示信息',
                    content: rs.info,
                    time:1,
                    cancelDisplay: false
                }).show();                
                //alert(rs.info);
                obj.html('绑定');
                obj.parent().prev('td').html('');
                obj.parent().prev('td').prev('td').html('');
                return;
            }else{
                 dialog({
                    fixed: true,
                    title: '提示信息',
                    content: rs.info,
                    time:1,
                    cancelDisplay: false
                }).show();
            }
        },'json');

    })
</script>